/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.click.app.dao.hibernate;

import com.click.app.dao.StorageProductDao;
import com.click.app.model.Product;
import com.click.app.model.StorageProduct;
import java.util.List;

/**
 *
 * @author orgale
 */
public class StorageProductDaoHibernate extends GenericDaoHibernate<StorageProduct, Long>
                                         implements StorageProductDao {

    public StorageProductDaoHibernate() {
        super(StorageProduct.class);
    }

    public List<StorageProduct> findByIdProduct(Long idProduct){
        return getHibernateTemplate().find(" from StorageProduct " +
                                           " where product.id = ? ", idProduct);
    }
    public List<StorageProduct> findByIdProductNoCero(Long idProduct){
        return getHibernateTemplate().find(" from StorageProduct " +
                                           " where product.id = ? and stock > 0 ", idProduct);
    }
}
